import re

def convert_to_mac_address(string):
    pattern = r"(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})(\w{2})"
    result = re.sub(pattern, r"\1:\2:\3:\4:\5:\6", string)
    return result

string = "001122334455"
mac_address = convert_to_mac_address(string)
print(mac_address)

file1 = open("C:/Users/Administrator/Desktop/mac.txt", "r")
file2 = open("C:/Users/Administrator/Desktop/macid.txt", "w")
lines = file1.readlines()
for line in lines:
    string = line
    mac_address = convert_to_mac_address(string)
    file2.write(mac_address)
    print(mac_address)
 #   print(line.strip())
file2.close()
file1.close()




